<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var fruit = prompt('请输入要查询价格的水果')
        switch (fruit) {
            case '苹果':
                alert('10元/斤');
                break;
            case '香蕉':
                alert('3元/斤');
                break;
            case '西瓜':
            alert('4元/斤');
            default:
                alert('没有您查询的水果');
        }
    </script>
</head>

<body>

</body>

</html>